//
//  BLSelectedList.h
//  ITC_iOS
//
//  Created by iBenz on 2018/9/8.
//  Copyright © 2018年 Benz.L. All rights reserved.
//

#import <UIKit/UIKit.h>
@class BLSelectedList, BLSelectedListRow;

@protocol BLSelectedListDelegate<NSObject>
@required
- (NSInteger)numberOfRowsInSelectedList:(BLSelectedList *)list;
- (__kindof BLSelectedListRow *)selectedList:(BLSelectedList *)list  cellForRow:(NSInteger)row;

@optional
- (CGFloat)selectedList:(BLSelectedList *)list heightForRow:(NSInteger)row;
- (void)selectedList:(BLSelectedList *)list didSelectedRow:(NSInteger)row;

@end

@interface BLSelectedList : NSObject
@property(nonatomic, assign) CGSize size;//default is {80,140}. Vaild before show.
@property(nonatomic, weak)   id<BLSelectedListDelegate> delegate;

- (BLSelectedListRow *)dequeueReusableCellWithIdentifier:(NSString *)identifier;
- (BLSelectedListRow *)dequeueReusableCellWithIdentifier:(NSString *)identifier forRow:(NSInteger)row;
- (void)registerClass:(nullable Class)cellClass forCellReuseIdentifier:(NSString *)identifier;
- (void)reload;

- (void)showWithRelatedView:(UIView *)view completion:(void (^ __nullable)(BLSelectedList *list, BOOL finished))completion;
- (void)hideCompletion:(void (^ __nullable)(BLSelectedList *list, BOOL finished))completion;

@end

@interface BLSelectedListRow : UITableViewCell
@end
